1. Field of the Invention
The invention relates to image processing, and more particularly to an image processing method and system capable of dividing images into several partitions, processing the partitions, and recombining the processed partitions as one image.
2. Description of the Related Art
For conventional hardware design of video game consoles, image processing (e.g. rendering, special effect, rotation, scaling, etc.) or display hardware is designed based on Quart Video Graphics Array (QVGA). FIG. 1A shows a QVGA image 100 with 320×240 resolution. The QVGA image 100 includes 240 pixel rows, and each pixel row includes 320 pixels. The QVGA image 100 can be generated by combining several processed QVGA images. For example, a QVGA image with horizontal flip can be combined with another QVGA image by alpha blending to generate the QVGA image 100. FIG. 1B shows a conventional timing diagram and hardware design of a video game console. The monitor 102 consists of 262 scan lines, whereby the 1st˜17th scan lines and the 258th˜262th scan lines are called a vertical blanking period. A vertical blanking period comprises a vertical front porch, a vertical back porch, and a vertical sync used for signal calibration and separation of consecutive images. It is noted that no image data exist in the scan lines during the vertical blanking period.
The counter 110 corresponds to the displaying time of scan lines on the monitor 102. For example, the monitor 102 displays the 1st scan line when the counter 110 count to 1, the monitor 102 displays the 2nd scan line when the counter 110 counts to 2, and so on. Moreover, the 18th scan line on the monitor 102 corresponds to the 1st pixel row of the QVGA image 100, the 19th scan line on the monitor 102 corresponds to the 2nd pixel row of QVGA image 100, and so on. The row buffers 104, 106, 108 can respectively store one pixel row of image 100. The row buffer 104 can store the 18th, 21st, 24th scan lines on the monitor 102, the row buffer 106 can store the 19th, 22nd, 25th scan lines on the monitor 102, and the row buffer 108 can store the 20th, 23rd, 26th scan lines on the monitor 102. The processing circuits may include a sprite circuit and a background circuit. Because each processing circuit can only process one pixel row at a time, the image processing of the QVGA image 100 should be operated as a pipeline to achieve the best performance.
The image processing pipeline of the QVGA image 100 is described as follows. When the counter 110 counts from 1 to 15, the sprite circuit and background circuit do not work. When the counter 110 counts to 16, the sprite circuit starts processing the 1st pixel row of the QVGA image 100, and then stores the processed 1st pixel row in the row buffer 104. When the counter 110 counts to 17, the background circuit starts processing the 1st pixel row of the QVGA image 100, and then stores the processed 1st pixel row in the row buffer 104. Concurrently, the sprite circuit starts processing the 2nd pixel row of the QVGA image 100, and then stores the processed 2nd pixel row in the row buffer 106. When the counter 110 counts to 18, the display circuit 112 reads the 1st pixel row from the row buffer 104 and display the 1st pixel row on the 18th scan line. Concurrently, the background circuit starts processing the 2nd pixel row of the QVGA image 100, and then stores the processed 2nd pixel row in the row buffer 106 and the sprite circuit starts processing the 3rd pixel row of the QVGA image 100, and then stores the processed 3rd pixel row in the row buffer 108. Continuing the process, when the counter 110 counts to 257, the display circuit 112 reads the 240th pixel row of the QVGA image 100 from the row buffer 108 and displays the 240th pixel row on the 257th scan line, whereby the QVGA image 100 is completely processed and displayed on the monitor 102.
However, as display device resolution capabilities rise, video games with higher resolutions (e.g. VGA (640×480) video games) are being developed. Accordingly, using available processing circuits to achieve higher-resolution image processing is needed in the art.